def fac(n: int) -> int:
    if n == 0: return 1 # (1) 边界条件
    pre = fac(n - 1)    # (2) 递归调用
    return n * pre 	    # (3) 递推结果

# 演示：输出0到10的阶乘
for i in range(11):
    print('%d! =' % i, fac(i))
